<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base target="_self">
    <title>修改交费</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="修改,交费">
	<meta http-equiv="description" content="This is my page">

	<style type="text/css">
	.indexDiv
	{
		width:500px;
		height:27px;
		display:inline;
		float:left;
		border-style:solid;
		border-width:1px;
		border-color:lightblue;
		padding: 2 2 2 2;
		margin:2 6 8 2;
	}
	</style>

  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'费用管理'},{'name':'交费情况'},{'name':'修改交费'}]"/>
    			<jsp:param name="width" value="40%"/>
    		</jsp:include>
    		
    		<s:hidden name="ct.id" id="tempId"></s:hidden>
    		<s:hidden name="tuition.child.id" id="childId"></s:hidden>
    		<s:hidden name="tuition.totalAmount" id="totalAmount"></s:hidden>
    		<s:hidden name="tuition.id" id="tuitionId"></s:hidden>
    		
    		<table width="100%" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
    			<tr bgcolor="#FFFFFF">
    				<td width="13%" align="right" class="label" height="24px">
    					收费单号：
    				</td>
    				<td width="37%" align="left">
    					<s:property value="tuition.tuitionNo"/>
    				</td>
    				<td width="13%" align="right" class="label">
    					收费日期：
    				</td>
    				<td width="37%" align="left">
    					<s:date name="tuition.payDate" format="yyyy-MM-dd"/>
    				</td>
    			</tr>
    			<tr bgcolor="#FFFFFF">
    				<td align="right" class="label" height="24px">
    					学童：
    				</td>
    				<td align="left">
    					<s:property value="tuition.child.childName"/>
    				</td>
    				<td align="right" class="label">
    					班级：
    				</td>
    				<td align="left">
    					<s:property value="tuition.cla.className"/>
    				</td>
    			</tr>
    			<tr bgcolor="#FFFFFF">
    				<td align="right" class="label" height="24px">
    					收款人：
    				</td>
    				<td align="left">
    					<s:property value="tuition.payee" />
    				</td>
    				<td align="right" class="label">
    					收款单位：
    				</td>
    				<td align="left">
    					<s:property value="tuition.unitName" />
    				</td>
    			</tr>
    			<tr bgcolor="#FFFFFF">
    				<td align="right" class="label">
    					保教费、伙&nbsp;&nbsp;<br/>
    					食费备注：
    					<br>
    					<font color="red">(40字以内)</font>
    				</td>
    				<td align="left">
    					<s:textarea name="tuition.remark" id="remark" cssStyle="width:400px; height:80px;"></s:textarea>
    				</td>
    				<td align="right" class="label">
    					代收代支&nbsp;&nbsp;<br/>
    					费用备注：
    					<br>
    					<font color="red">(40字以内)</font>
    				</td>
    				<td align="left">
    					<s:textarea name="tuition.remarkOfOther" id="remarkOfOther" cssStyle="width:400px; height:80px;"></s:textarea>
    				</td>
    			</tr>
    			<tr bgcolor="#FFFFFF">
    				<td align="right" class="label">
    					指标：
    				</td>
    				<td align="left" colspan="3" id="indexTd">
    					<iframe frameborder="0"
    					 scrolling="no"
    					 width="100%"
    					 id="indexFrame" 
    					 name="indexFrame"
    					 src="${CONTEXT_PATH}/inner/charge/tuitionDetailManage.action?tdvo.td.id=<s:property value='tuition.id' />&tuition.child.id=<s:property value='tuition.child.id' />"
    					 ></iframe>
    				</td>
    			</tr>
    		</table>
    		
    		<table width="100%" cellspacing="0">
    			<tr>
    				<td align="center" valign="bottom" height="30">
    					<my:hasPermission privilegeId="updateTuition">
    					<input type="button" value="修改" class="btn" onclick="updateTuition()" />
    					</my:hasPermission>
    					<my:hasPermission privilegeId="toPrintTuition">
    					<input type="button" value="打印" class="btn" onclick="toPrint()" />
    					</my:hasPermission>
    				</td>
    			</tr>
    		</table>
    		
    	</s:form>
    </center>
    
    <script type="text/javascript">
    function updateTuition()
    {
    	var description = $('#description');
    	var remark = $('#remark');
    	var remarkOfOther = $('#remarkOfOther');
    	if(remark.val().length > 40)
    	{
    		showMsg('备注不能超过40字。', function(){remark.focus();});
    		return;
    	}
    	if(remarkOfOther.val().length > 40)
    	{
    		showMsg('代收代支费用备注不能超过40字。', function(){remarkOfOther.focus();});
    		return;
    	}
    	var url = 'inner/charge/updateTuition.action';
    	ajaxAction(url, 'post', 'frm', false);
    }

    function toPrint(){
    	var tid = $('#tuitionId');
    	var url = realPath + '/inner/charge/toPrintTuition.action?tuition.id='+ tid.val();
    	openWin(url, 1200, 800, 'yes', 'yes');
    }
    
    </script>
  </body>
</html>
